Returns the greatest common factor of polynomial 1 and polynomial 2.